#ifndef THREADSAFEQUEUE_H
#define THREADSAFEQUEUE_H

#include <queue>
#include <mutex>
#include <condition_variable>
#include <opencv2/opencv.hpp>

class ThreadSafeQueue
{
public:
    const int MAX_QUEUE_SIZE = 20;

    ThreadSafeQueue();
    std::queue<cv::Mat> frames;
    std::mutex mtx;
    std::condition_variable cond;

    void push(cv::Mat frame);
    cv::Mat pop();
    int count();
    void clear();
};

#endif // THREADSAFEQUEUE_H
